package com.changanw.lettuce;

import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisCommands;

public class LettuceTest {
    public static void main(String[] args) {
        //创建一个实例
        RedisClient redisClient = RedisClient.create("redis://12345@localhost");
        //获取一个连接
        StatefulRedisConnection<String, String> connect = redisClient.connect();
        //获取一个对象
        RedisCommands<String, String> sync = connect.sync();
        sync.set("name","changanw");
        System.out.println(sync.get("name"));
    }
}
